home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / lua.lang < prev    next >
Encoding:
Extensible Markup Language  |  2010-08-16  |  5.1 KB  |  157 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Bj├╕rn Lindeijer <bjorn@lindeijer.nl>
  5.  Copyright (C) 2004 Bj├╕rn Lindeijer <bjorn@lindeijer.nl>
  6.  
  7.  This library is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU Library General Public
  9.  License as published by the Free Software Foundation; either
  10.  version 2 of the License, or (at your option) any later version.
  11.  
  12.  This library is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  Library General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU Library General Public
  18.  License along with this library; if not, write to the
  19.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  Boston, MA 02111-1307, USA.
  21.  
  22. -->
  23. <language id="lua" _name="Lua" version="2.0" _section="Scripts">
  24.   <metadata>
  25.     <property name="mimetypes">text/x-lua</property>
  26.     <property name="globs">*.lua</property>
  27.     <property name="line-comment-start">--</property>
  28.     <property name="block-comment-start">--[[</property>
  29.     <property name="block-comment-end">]]</property>
  30.   </metadata>
  31.  
  32.   <styles>
  33.     <style id="comment" _name="Comment" map-to="def:comment"/>
  34.     <style id="string" _name="String" map-to="def:string"/>
  35.     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
  36.     <style id="escape" _name="Escaped Character" map-to="def:special-char"/>
  37.     <style id="reserved" _name="Reserved Identifier" map-to="def:keyword"/>
  38.     <style id="function" _name="Function" map-to="def:function"/>
  39.     <style id="nil-value" _name="Nil Constant" map-to="def:special-constant"/>
  40.     <style id="boolean" _name="Boolean value" map-to="def:boolean"/>
  41.   </styles>
  42.  
  43.   <definitions>
  44.     <context id="lua-escape" style-ref="escape">
  45.       <match>\\(\d\d?\d?|.)</match>
  46.     </context>
  47.  
  48.     <context id="string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
  49.       <start>["']</start>
  50.       <end>\%{0@start}</end>
  51.       <include>
  52.         <context ref="lua-escape"/>
  53.         <context ref="def:line-continue"/>
  54.       </include>
  55.     </context>
  56.  
  57.     <context id="multi-line-string" style-ref="string" class="string" class-disabled="no-spell-check">
  58.       <start>\[(=*)\[</start>
  59.       <end>]\%{1@start}]</end>
  60.     </context>
  61.  
  62.     <context id="block-comment" style-ref="comment" class="comment" class-disabled="no-spell-check">
  63.       <start>--\[(=*)\[</start>
  64.       <end>]\%{1@start}]</end>
  65.       <include>
  66.     <context ref="def:in-comment"/>
  67.       </include>
  68.     </context>
  69.  
  70.     <context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check">
  71.       <start>--</start>
  72.       <include>
  73.     <context ref="def:in-comment"/>
  74.       </include>
  75.     </context>
  76.  
  77.     <context id="keywords" style-ref="keyword">
  78.       <keyword>and</keyword>
  79.       <keyword>break</keyword>
  80.       <keyword>do</keyword>
  81.       <keyword>else</keyword>
  82.       <keyword>elseif</keyword>
  83.       <keyword>end</keyword>
  84.       <keyword>for</keyword>
  85.       <keyword>function</keyword>
  86.       <keyword>if</keyword>
  87.       <keyword>in</keyword>
  88.       <keyword>local</keyword>
  89.       <keyword>not</keyword>
  90.       <keyword>or</keyword>
  91.       <keyword>repeat</keyword>
  92.       <keyword>return</keyword>
  93.       <keyword>then</keyword>
  94.       <keyword>until</keyword>
  95.       <keyword>while</keyword>
  96.     </context>
  97.  
  98.     <context id="functions" style-ref="function">
  99.       <keyword>assert</keyword>
  100.       <keyword>collectgarbage</keyword>
  101.       <keyword>dofile</keyword>
  102.       <keyword>error</keyword>
  103.       <keyword>getfenv</keyword>
  104.       <keyword>getmetatable</keyword>
  105.       <keyword>gcinfo</keyword>
  106.       <keyword>ipairs</keyword>
  107.       <keyword>loadfile</keyword>
  108.       <keyword>loadlib</keyword>
  109.       <keyword>loadstring</keyword>
  110.       <keyword>next</keyword>
  111.       <keyword>pairs</keyword>
  112.       <keyword>pcall</keyword>
  113.       <keyword>print</keyword>
  114.       <keyword>rawequal</keyword>
  115.       <keyword>rawget</keyword>
  116.       <keyword>rawset</keyword>
  117.       <keyword>require</keyword>
  118.       <keyword>setfenv</keyword>
  119.       <keyword>setmetatable</keyword>
  120.       <keyword>tonumber</keyword>
  121.       <keyword>tostring</keyword>
  122.       <keyword>type</keyword>
  123.       <keyword>unpack</keyword>
  124.       <keyword>xpcall</keyword>
  125.     </context>
  126.  
  127.     <context id="lua-reserved" style-ref="reserved">
  128.       <keyword>_[A-Z][A-Za-z0-9_]*</keyword>
  129.     </context>
  130.  
  131.     <context id="nil-value" style-ref="nil-value">
  132.        <keyword>nil</keyword>
  133.     </context>
  134.  
  135.     <context id="boolean" style-ref="boolean">
  136.        <keyword>false</keyword>
  137.        <keyword>true</keyword>
  138.     </context>
  139.  
  140.     <context id="lua" class="no-spell-check">
  141.       <include>
  142.         <context ref="def:shebang"/>
  143.         <context ref="multi-line-string"/>
  144.         <context ref="string"/>
  145.         <context ref="block-comment"/>
  146.         <context ref="line-comment"/>
  147.         <context ref="keywords"/>
  148.         <context ref="functions"/>
  149.         <context ref="lua-reserved"/>
  150.         <context ref="nil-value"/>
  151.         <context ref="boolean"/>
  152.       </include>
  153.     </context>
  154.  
  155.   </definitions>
  156. </language>
  157.